<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>聊天系统</title>
    <link rel="stylesheet" href="./css/aui_font.css">
    <link rel="stylesheet" href="./css/base_icon.css?v=1.0.1">
    <link rel="stylesheet" href="./css/news.css?v=1.0.1">
    <!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=yCtzawE7yIZYXl9jnlgPXmlrtNgjSaFA">
    </script>
    <script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script> -->
    <style>
        #wrap {
            /* margin-bottom: 55px; */
            display: flex;

        }

        #wrap .talk-list {
            width: 30vw;
            height: 100vh;
            overflow-y: scroll;
            position: relative;
        }


        #wrap .talk-detail {
            width: 70vw;
            height: 100vh;
            overflow-y: scroll;
            position: relative;
        }

        @media screen and (max-width: 640px) {
            #wrap .talk-list {
                width: 80px;
            }

            #wrap .talk-detail {
                width: calc(100vw - 80px);
            }
        }


        #fn-head {
            position: sticky;
            position: -webkit-sticky;
            top: 0;
            z-index: 100;
        }

        /* 第一个头部 */
        .h-wrap .one {
            color: #222;
            font-size: 14px;
            font-weight: bold;
        }

        .h-wrap .one .location .aui-iconfont {
            font-size: 12px;
            font-weight: bold;
        }

        .h-wrap .one .location .city {
            margin: 0 2px;
        }

        .h-wrap .one .title {
            width: 35vw;
            border: 1px solid #eee;
            padding: 5px 15px;
            border-radius: 15px;
        }

        .h-wrap .one .title .line {
            width: 1px;
            height: 20px;
            background: #eee;
        }

        .h-wrap .wrap {
            background: #fff;
            color: #000;
            border-bottom: 1px solid #eee;
        }

        .h-wrap .wrap .list {
            padding: 10px 0;
            font-size: 14px;
            /* border-bottom: 1px solid #eee; */
            position: relative;
        }

        .h-wrap .wrap .list.active {
            border-bottom: 2px solid #9763fc;
            color: #9763fc;
        }

        /* 第二个头部 */
        .h-wrap .two {
            /* color: #9763fc;
            font-size: 16px; */
            color: #222;
            font-size: 14px;
            font-weight: bold;
            line-height: 52px;
        }

        .h-wrap .two span {
            width: 20vw;
            font-size: 14px;
            color: #9763fc;
            font-weight: normal;
        }

        /* 第三个头部 */
        .h-wrap .com .title,
        .h-wrap .tri .title,
        .h-wrap .for .title {
            /* color: #9763fc;
            font-size: 16px; */
            color: #222;
            font-size: 14px;
            font-weight: bold;
            line-height: 52px;
        }

        .tri .num {
            position: absolute;
            top: calc(50% - 13px);
            /* left: 60%; */
            left: calc(50% + 20px);
            border-radius: 10px;
            width: 35px;
            padding: 1.5px 0;
            background: #663DFB;
            color: #fff;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 第四个头部 */
        .h-wrap .for {
            line-height: 52px;
            color: #9763fc;
        }

        .h-wrap .for .edit {
            font-size: 14px;
            width: 20vw;
            text-align: center;
        }

        #footer {
            position: fixed;
            bottom: 0;
            /* left: 0; */
            border-top: 1px solid #eee;
            background: #fff;
            z-index: 100;
            max-width: 750px;
            min-width: 320px;
            ;
        }


        #footer .f-list {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 25vw;
            font-size: 12px;
            padding: 15px 0;
            color: #757575;
            position: relative;

        }

        #footer .f-list span#js-num {
            position: absolute;
            top: 5px;
            left: 55%;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            background: #9763fc;
            color: #fff;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #footer .f-list.active {
            color: #9763fc;
        }

        #footer .f-list img {
            width: 20px;
            /* height: 20px; */
        }

        #footer .f-list span {
            display: none;
            font-weight: bold;
            color: #8962d0;
        }

        #footer .f-list.active span {
            display: inline-block;
        }

        #footer .f-list.active img {
            display: none;
        }

        .logout-btn {
            width: 100%;
            text-align: center;
            line-height: 50px;
            background: #eee;
        }

        body {}
    </style>
</head>

<body class="body">
    <div id="wrap">
        <div class="talk-list"></div>
        <div class="talk-detail"></div>
    </div>
    <!-- 脚部 -->
    <!-- <footer id="footer" style="width: 100%;">
        <div class="logout-btn" onclick="_login()">退出登录</div>
    </footer> -->
    <!-- <footer id="footer">
        <ul class="f-wrap flex">
            <li class="f-list active" onclick="loadInner(0)">
                <img src="./image/index_images/button1.png?t=1586566770271" alt="">
                <span>首页</span>
            </li>
            <li class="f-list" onclick="loadInner(1)">
                <img src="./image/index_images/button2.png?t=1586566770271" alt="">
                <span>电台</span>
            </li>
            <li class="f-list" onclick="loadInner(2)">
                <img src="./image/index_images/button3.png?t=1586566770271" alt="">
                <span>消息</span>
                <span class="num new-hide" id="js-num"></span>
            </li>
            <li class="f-list" onclick="loadInner(3)">
                <img src="./image/index_images/button4.png?t=1586566770271" alt="">
                <span>我的</span>
            </li>
        </ul>
    </footer> -->
</body>
<script src="./script/jquery_min.js"></script>
<script src="./script/ffkj.js?v=1.0.1"></script>
<script src="./script/wximg.js"></script>
<script src="./script/vue.js"></script>
<script src="./script/socket.js?v=1.0.1"></script>
<script>
    var urlIndex = getCookie('urlIndex') || 0;
    loadInner(2)

    function loadInner(index) {
        var admin = getCookie('admin');
        if (!admin) {
            window.location.href = phpurl + "chats";
            return;
        }


        // judgeLogin();
        // setOnline(1);
        // var nameArr = ['frame0', 'frame1', 'frame2', 'frame3'];
        // var titleArr = ['首页', '电台', '消息', '我的'];
        // setCookie('urlIndex', index);
        // var name = nameArr[index];
        _load('#wrap .talk-list', 'frame2/frame2-1');
        // setTimeout(function(){

        // }, 1000)
        // showTab(index);
        // $('title').text(titleArr[index]);
        // openWS()
    }
    // 显示 底部图标及头部
    function showTab(index) {
        var len = $('#footer .f-list').length;
        $('#footer .f-list').eq(index).addClass('active').siblings().removeClass('active');
    }
    // window.BMap = BMap;
    // var BMap = window.BMap
    // var geolocation = new BMap.Geolocation()

    // geolocation.enableSDKLocation(); //允许SDK辅助
    // geolocation.getCurrentPosition(function (r) {
    //     if (this.getStatus() == 0) {
    //         var lon = r.longitude;
    //         var lat = r.latitude;
    //         if (lon && lon != 'undefined') {
    //             setCookie('lon', lon);
    //         }
    //         if (lat && lat != 'undefined') {
    //             setCookie('lat', lat);
    //         }
    //         _ajax('Home/User/setJW', function (rets) {
    //             loadInner(urlIndex);
    //         }, {
    //             userid:  getCookie('userid'),
    //             longitude: getCookie('lon'),
    //             latitude: getCookie('lat')
    //         })
    //     }
    // })


    // function openWS() {
    //     // 建立长连接
    //     var _ws = new WS();
    //     _ws.open(function () {
    //         _ws.send(JSON.stringify({
    //             userid: -1
    //         }));
    //     });

    //     // 长连接 渲染数据
    //     _ws.get(function (rets) {
    //         if (rets.indexOf('action') != -1) {
    //             rets = JSON.parse(rets);
    //             // _log(JSON.stringify(rets))
    //             if (rets) {
    //                 // 渲染消息数量 Home/Privatechat/getreadcount
    //                 if (rets.action == 'Home/Privatechat/getreadcount') {
    //                     _log(JSON.stringify(rets))
    //                     var result = rets.data;
    //                     changeMsgNum(result.chat_count, result.message_count)
    //                 }
    //             }
    //         }
    //     })
    //     setTimeout(function () {
    //         pushMsg(myuserid);
    //     }, 1000)
    // }
</script>

</html>